<template>

  <div class="container" id="walletInfo">
    <div class="head-top">
      <span>管理钱包</span>
      <img @click="$router.back()" src="static/img/return.png"/>
    </div>


    <div class="walletBox" >
      <div class="wallet-block" v-for="(account,index) in wallet" :key="index">
        <div class="top" @click="switchWallet(index)">
          <div class="name">
            <img :src="account.img">
            <span>{{account.name}}</span>
          </div>
          <div class="address">
            {{account.address}}
          </div>
        </div>
        <div class="ether">
          {{parseFloat(account.eth).toFixed(4)}}<span>ether</span>
        </div>
      </div>
    </div>
    <div class="found" @click="$router.push({name:'EthCreateWallet'})">
      <img src="static/img/addWallet.png" alt />
      <span>创建钱包</span>
    </div>
    <div class="import-walet" @click="$router.push({name:'EthImportWallet'})">
      <img src="static/img/importWallet.png" alt />
      <span>导入钱包</span>
    </div>



  </div>

</template>

<script>

  import accountUtils from "../../service/eth/accountUtils.js";
  import  web3Utils from "../../service/eth/web3Utils.js";

  import { Icon } from 'vant';

  import {mapGetters, mapActions} from 'vuex'

  import axios from 'axios'
  import Clipboard from 'clipboard'
  import {Popup,Button,Picker  } from 'mint-ui'

  export default {
    components: {
      Popup
    },
    data() {
      return {
        walletType:'ETH',
        columns: ['ETH']
      }
    },
created(){

},
    computed: {
      ...mapGetters(['wallet','accountIndex','currentAccount'])
    },
    methods: {
      ...mapActions(['setWallet','setAccountIndex','setCoinByIndex','setEthBalance','setEthPrice','setBalance','setWalletAccountByIndex']),

      switchWallet(index){
          this.$router.push({name:'EthWalletInfo',params:{index:index}})
      },
      changeWallet(value) {
        this.walletType=value

      }
    },
    async mounted() {
console.log(this.currentAccount)

    }
  }
</script>
<style lang="less" scoped>
  @import url("../../assets/css/myWallet.less");
</style>

